package model.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * 多线程，监听55533端口，等待客户机Socket连接
 */
public class ServerListener extends Thread {
    @Override
    public void run() {
        try {
            ServerSocket serverSocket = new ServerSocket(55533);
            System.out.println("...服务器启动成功...");
            while (true) {
                Socket socket = serverSocket.accept();
                ServerThread serverThread = new ServerThread(socket);
                serverThread.start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
